//抽离公共页面
$(function () {
    $('.footer').load('../public-footer');
});
$(function () {
    $('.header').load('../public-header');
});
$(function () {
    $('.router-menu').load('../public-router');
});
$(function () {
    $('.brand-banner').load('../public-swiper');
});
$(function () {
    $('.brand-footer').load('../public-brandfoot');
});

$(document).ready(function () {
    function bindAPath() {
        $('a').each(function () {
            $(this).on('click', function (e) {
                localStorage.setItem('path', JSON.stringify({
                    name: document.title,
                    path: location.href
                }))
            })
        })
    }
    bindAPath()
    var newLink = $('<link rel="icon" type="image/x-icon" />');

    // 设置新 favicon 的 href 属性
    newLink.attr('href', '../static/asset/image/common/favicon.ico');

    // 移除旧的 favicon
    $('link[rel="icon"]').remove();

    // 将新的 favicon 添加到 head
    $('head').append(newLink);
    setTimeout(() => {
        let Y = new Date().getFullYear()
        $('.copyright').text(`@${Y} Pengcloud Limited. All rights reserved.`)
    }, 500);
})
